package java8.atguigu.teacher.annotation;

import com.alibaba.fastjson.JSON;
import org.junit.Test;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program lambda
 * @description:
 * @author: zhanglu
 * @create: 2019-06-02 15:46:00
 * 重复注解与类型注解
 */
public class TestAnnotation {

    private @NotNull Object obj = null;

    @MyAnnotation01("Hello")
    @MyAnnotation01("World")
    public void show(){

    }

    @Test
    public void test01() throws NoSuchMethodException {
//        Class<TestAnnotation> clazz = TestAnnotation.class;
//        Method m1 = clazz.getMethod("show");
//        MyAnnotation01[] mas = m1.getAnnotationsByType(MyAnnotation01.class);
//        for(MyAnnotation01 m : mas){
//            System.out.println(m.value());
//        }
        List<Map> ls = new ArrayList<>();
        Map<String, Object> m = new HashMap<>();
        m.put("name", "入所时间");
        m.put("k", "time");
        m.put("v", "3");
        m.put("op", "<");
        m.put("date", 1);

        Map<String, Object> m1 = new HashMap<>();
        m1.put("name", "戒毒机构编码");
        m1.put("k", "jdjgbm");
        m1.put("group", 1);

        ls.add(m1);
        ls.add(m);
        System.out.println(JSON.toJSONString(ls));
    }

}
